import '../common/lib';
import LteHead from '../component/LteHead';
import LteLeftNav from '../component/LteLeftNav';
import Home from '../component/Home';
import Book from '../component/Book';
import ReactDOM from 'react-dom';
import React from 'react';
import { Router, Route, Link,IndexRoute,useRouterHistory} from 'react-router';
import createBrowserHistory from 'history/lib/createBrowserHistory';
import useScroll from 'scroll-behavior/lib/useScrollToTop';

const appHistory = useScroll(useRouterHistory(createBrowserHistory))();

class App extends React.Component{
	render(){
		return (
			<div className="ltewrap">
				<LteHead userTitle="AdminLte"  url="src/images/user.jpg" userName="Alexander Pierce"  />
				<LteLeftNav />			
				<div id='maincontent' clasName="maincontent">
          			{this.props.children}
        		</div>
			</div>
		);
	}
};
class Movie extends React.Component{  
  render() {
    return (
      <article>
       <h3>次页面</h3>
			<h3>次页面</h3>
			<h3>次页面</h3>
			<h3>次页面</h3>
			<h3>次页面</h3>
      </article>
    )
  }
};
ReactDOM.render((
  <Router history={appHistory}>
    <Route path="/" component={App}>
        <IndexRoute  component={Home}/>
        <Route path="movie" component={Movie} />
        <Route path="book" component={Book} />
    </Route>
  </Router>
), document.getElementById('react-content'));

